﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CardAccountingAdd.aspx.cs" Inherits="Customer_Profile.eCard.CardAccount.CardAccountingAdd" %>
<%@ Register Src="~/mainTop.ascx" TagName="mainTop" TagPrefix="uc1" %>
<%@ Register assembly="DevExpress.Web.ASPxGridView.v9.3, Version=9.3.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxGridView" tagprefix="dx" %>
<%@ Register assembly="DevExpress.Web.ASPxEditors.v9.3, Version=9.3.3.0, Culture=neutral, PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxEditors" tagprefix="dx" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Customer List</title>
    <meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR" />
    <meta content="C#" name="CODE_LANGUAGE" />
    <meta content="JavaScript" name="vs_defaultClientScript" />
    <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="/css/style.css" type="text/css" rel="stylesheet" />
    <script language="javascript" type="text/javascript" src="/js/common.js"></script>
    <script language="javascript" type="text/javascript" src="/js/CalPopUp.js"></script>
    <script language="javascript" >
        function grid_SelectionChanged(s, e) {
            s.GetSelectedFieldValues("deal_no", GetSelectedFieldValuesCallback);
        }
        function GetSelectedFieldValuesCallback(values) {
            var extent_dealno = "";
            try {
                for (var i = 0; i < values.length; i++) {
                    extent_dealno += values[i] //+ ","
                    //alert(extent_dealno);
                }
            } finally {
            }
            //document.getElementById("selCount").innerHTML = grid.GetSelectedRowCount();
            //alert(extent_cardno);
            var hiddealno = document.getElementById("hidDealno");
            hiddealno.value = extent_dealno;
        }
        function recharge_redirect() {
            var card_balance_temp = document.getElementById("card_balance").value;
            var consume_amount = document.getElementById("txtAmount").value;
            
            if (consume_amount == '') {
                alert("金额不能为空");
                return false;
            }
            var i_balance =parseFloat(consume_amount) + parseFloat(card_balance_temp);
            if (i_balance < 0) {
                alert("卡内余额不足！");
                return false;
            }

            var hiddealno = document.getElementById("hidDealno");
            var strdealno = hiddealno.value;
            if (strdealno == '') {
                alert("请至少选择一条数据进行充值！");
                return false;
            }
            else {
                //alert(strcardno);                
                return true;
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
      <table height="100%" cellspacing="0" cellpadding="0" width="100%" border="0">
            <tr>
                <td width="1" background="/images/dot_vline.gif">
                    <img height="1" src="/images/spacer.gif" width="1"></td>
                <td valign="top" width="15">
                    <img height="1" src="/images/spacer.gif" width="15"></td>
                <td id="TD1" valign="top" runat="server">
                    <table cellspacing="0" cellpadding="0" width="100%" border="0">
                        <tr>
                            <td>
                                <img height="5" src="/images/spacer.gif" width="1"></td>
                        </tr>
                        <tr>
                            <td height="23">
                                <span class="navi-blk">
                                    <uc1:mainTop ID="MainTop1" runat="server"></uc1:mainTop>
                                    个人旅行卡->卡帐充值 </span>
                            </td>
                        </tr>
                        <tr>
                            <td background="/images/dot_hline.gif">
                                <img height="1" src="/images/spacer.gif" width="1"></td>
                        </tr>
                    </table>
                    <table cellspacing="0" cellpadding="0" width="100%" border="0">
                        <tr>
                            <td>
                                <img height="8" src="/images/spacer.gif" width="1"></td>
                        </tr>
                    </table>
                   <table cellspacing="0" cellpadding="0" width="100%" border="0">
                        <tr>
                            <td>
                                <table bordercolor="#c2d2e2" cellspacing="0" cellpadding="2" width="100%" border="1">
                                    <tr>
                                        <td colspan=2>
                                            <table cellspacing="0" cellpadding="0" width="100%" border="0">
                                                <tr>
                                                    <td bgcolor="#1765a7">
                                                        <img height="11" src="/images/pic_results.gif" width="61"></td>
                                                </tr>
                                            </table>
                                            <dx:ASPxGridView ID="gridDeal" runat="server" KeyFieldName="deal_no" 
                                                AutoGenerateColumns="False" 
                                                CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" 
                                                CssPostfix="Office2003Blue">
                                                <Columns>
                                                    <dx:GridViewCommandColumn ShowSelectCheckbox="True" VisibleIndex="0"></dx:GridViewCommandColumn>
                                                    <dx:GridViewDataColumn FieldName="deal_no" VisibleIndex="1" Caption="交易号" />
                                                    <dx:GridViewDataColumn FieldName="cparty_name" VisibleIndex="2" Caption="客户姓名" />                        
                                                    <dx:GridViewDataColumn FieldName="procduct_name" VisibleIndex="3" Caption="产品名称" />
                                                    <dx:GridViewDataColumn FieldName="initial_amount" VisibleIndex="4" Caption="购买金额" />
                                                    <dx:GridViewDataColumn FieldName="due_amount" VisibleIndex="5" Caption="到期金额" />
                                                    <dx:GridViewDataColumn FieldName="value_date" VisibleIndex="6" Caption="起息日" />
                                                    <dx:GridViewDataColumn FieldName="due_date" VisibleIndex="7" Caption="到期日" />
                                                    <dx:GridViewDataColumn FieldName="deal_balance" VisibleIndex="8" Caption="交易余额" />
                                                </Columns>
                                                <ClientSideEvents SelectionChanged="grid_SelectionChanged" />
                                                <Images SpriteCssFilePath="~/App_Themes/Office2003Blue/{0}/sprite.css">
                                                    <LoadingPanelOnStatusBar Url="~/App_Themes/Office2003Blue/GridView/gvLoadingOnStatusBar.gif">
                                                    </LoadingPanelOnStatusBar>
                                                    <LoadingPanel Url="~/App_Themes/Office2003Blue/GridView/Loading.gif">
                                                    </LoadingPanel>
                                                </Images>
                                                <ImagesFilterControl>
                                                    <LoadingPanel Url="~/App_Themes/Office2003Blue/Editors/Loading.gif">
                                                    </LoadingPanel>
                                                </ImagesFilterControl>
                                                <Styles CssFilePath="~/App_Themes/Office2003Blue/{0}/styles.css" 
                                                    CssPostfix="Office2003Blue">
                                                    <Header ImageSpacing="5px" SortingImageSpacing="5px">
                                                    </Header>
                                                    <LoadingPanel ImageSpacing="10px">
                                                    </LoadingPanel>
                                                </Styles>
                                                <StylesEditors>
                                                    <ProgressBar Height="25px">
                                                    </ProgressBar>
                                                </StylesEditors>
                                            </dx:ASPxGridView>
                                            <asp:HiddenField ID="hidDealno" runat="server" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">卡号：</td>
                                        <td><asp:TextBox ID="txtCardno" runat="server" Enabled="false"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td align="right">当前余额：</td>
                                        <td><asp:TextBox ID="card_balance" runat="server" Enabled="false"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td align="right">调账类型：</td>
                                        <td>
                                            <asp:RadioButtonList ID="rbCflowType" runat="server" 
                                                RepeatDirection="Horizontal">
                                            </asp:RadioButtonList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">调整金额：</td>
                                        <td><asp:TextBox ID="txtAmount" runat="server"></asp:TextBox>必填：负值代表账户扣款。</td>
                                    </tr>
                                    <tr>
                                        <td align="right">附件：</td>
                                        <td>                                            
                                            <asp:FileUpload ID="FileUpload1" runat="server" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="right">备注：</td>
                                        <td><asp:TextBox ID="txtRemark" runat="server"></asp:TextBox></td>
                                    </tr>
                                    <tr>
                                        <td align="right">
                                            提示：
                                        </td>
                                        <td>
                                            <asp:Label ID="lblWarning" runat="server" ForeColor="Red" ></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <hr />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" align="center">
                                            <asp:Button ID="btnAction" runat="server" Text="充值" OnClientClick="return recharge_redirect()" onclick="btnAction_Click" />
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
                <td valign="top" width="10"><img height="1" src="/images/spacer.gif" width="10"></td>
            </tr> 
    </table> 
    </form>
</body>
</html>